home *** CD-ROM | disk | FTP | other *** search
- Path: cc2000.kyoto-su.ac.jp!usenet
- From: Phil Boyd <boydp@hdc-usa.com>
- Newsgroups: comp.lang.c
- Subject: Re: A question on for loop
- Date: Wed, 13 Mar 1996 10:35:32 -0800
- Organization: Horizon Data Corporation
- Message-ID: <31471574.79D9@hdc-usa.com>
- NNTP-Posting-Host: 150.226.19.37
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Jonas J. Schlein wrote:
- >
- > Murali Chari <murali@sooraj.ebay.sun.com> wrote:
- > |> In the following piece of code:
- > |>
- > |> for(i=0;i< 20; i++)
- > |> {
- > ...
- > |> if(condition==FALSE)
- > |> continue;
- > ...
- > |> }
- > |>
- > |> Let us assume i=10 before it entered the loop.
- > |> The condition was false. So the continue statement
- > |> got executed.
- > |>
- > |> Will control now go to the third statement in the for loop?
- > |> i.e. will i be incremented by 1 and again tested for the condition?
- >
- > Continue does exactly that. It says continue to the next loop iteration.
- > Do not pass go do not pass $200 ;-). So, yes 'i' will be incremented
- > and tested again. I'll just assume that FALSE is defined somewhere
- > as well as 'condition'.
- > --
- > "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
- >
- > Jonas J. Schlein (schlein@gl.umbc.edu)
-
- OK, now for a newbie question just for my own edification:
-
- Inside the for loop - does "i" start off with the value 0 so that
- the loop has the potential to repeat up to 20 times (assuming that
- "condition" remains FALSE)?
-
- Thanks for the help
-